<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Example Constraint Handlers
</TITLE>
</HEAD>
<BODY >
<A HREF="libman044.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman042.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman046.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc82">8.3</A>&nbsp;&nbsp;Example Constraint Handlers</H2>
All example files are in the subdirectory <TT>lib/chr</TT> of the
installation-directory of ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> (which can be found using <TT>get_flag(installation_directory,Dir)</TT><A NAME="@default216"></A>. 
The files (<TT>.chr, .pl</TT>, examples)
relevant to a
particular constraint system can be found by looking at all files that
match the pattern given in the following listing with each example
handler. The examples include a <EM>colour graphic demo</EM> about
optimal sender placement for wire-less devices in buildings and
company sites, small constraint handlers for
<UL CLASS="itemize"><LI CLASS="li-itemize">
minimum, maximum of and inequalities between terms (<TT>*minmax*</TT>)<A NAME="@default217"></A>,
<LI CLASS="li-itemize">terms (<TT>functor/3, arg/3, =..</TT> as constraints) (<TT>*term*</TT>)<A NAME="@default218"></A>,
<LI CLASS="li-itemize">lists (similar to Prolog III) (<TT>*list*</TT>)<A NAME="@default219"></A>,
<LI CLASS="li-itemize">rational trees (<TT>*tree*</TT>)<A NAME="@default220"></A>,
<LI CLASS="li-itemize">sound if-then-else, negation and checking, 
 lazy conjunction and disjunction (<TT>*control*</TT>)<A NAME="@default221"></A>,
<LI CLASS="li-itemize">geometric reasoning about rectangles (<TT>*demo*</TT>)<A NAME="@default222"></A>,
</UL>
and larger constraint handlers for
<UL CLASS="itemize"><LI CLASS="li-itemize">
booleans for propositional logic (<TT>*bool*</TT>)<A NAME="@default223"></A><A NAME="@default224"></A>,
<LI CLASS="li-itemize">finite and <EM>infinite</EM> domains (inspired by CHIP) (<TT>*domain*</TT>)<A NAME="@default225"></A>,
<LI CLASS="li-itemize">sets (<TT>*set*</TT>)<A NAME="@default226"></A>,
<LI CLASS="li-itemize">terminological reasoning (similar to KL-ONE) [<A HREF="libman072.html#fru93b"><CITE>8</CITE></A>] (<TT>*kl-one*</TT>)<A NAME="@default227"></A>,
<LI CLASS="li-itemize">temporal reasoning (over time points and intervals) [<A HREF="libman072.html#fru93"><CITE>7</CITE></A>] (<TT>*time*</TT>)<A NAME="@default228"></A>,
<LI CLASS="li-itemize">equation solving over real numbers (similar to CLP(R)) or rational numbers (<TT>*math*</TT>)<A NAME="@default229"></A><A NAME="@default230"></A>.
</UL>
<FONT COLOR=purple>CHR</FONT>s have also been used as a committed choice programming language
on their own (<TT>*prime*</TT>)<A NAME="@default231"></A>.<BR>
<BR>
The example handlers can be loaded using <CODE>chr(lib(File))</CODE>. For
instance the finite domain handler can be made available as follows
(the current directory must have write permission so that
the <TT>pl</TT> file can be created):
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
[eclipse 1]: lib(chr), chr(lib(domain)).
...
domain.pl  compiled traceable 241028 bytes in 1.22 seconds

yes.
[eclipse 2]: X::1..10, X ne 5.

X = X

Constraints:
(4) X_g1165 :: [1, 2, 3, 4, 6, 7, 8, 9, 10]

yes.
</PRE></BLOCKQUOTE>
<HR>
<A HREF="libman044.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman042.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman046.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
